import Vue from "vue"
import Router from "vue-router"

//默认情况下如果目录下的文件名称为index.vue，可以省略不写index.vue
import Login from "./views/login"
import Layout from "@/components/Layout"
import Home from "@/views/home"
import Member from "@/views/member"
import Supplier from "@/views/supplier"
import Goods from "@/views/goods"
import Staff from "@/views/staff"

Vue.use(Router)


export default new Router({
    routes: [
        {
            path: '/',
            name: "login",//默认访问登陆页面
            redirect: "/login"
        },
        {
            path: '/login',
            name: "login",//路由名称
            component: Login
        },
        /*{
            path: '/',
            name: "layout",//路由名称
            component: Layout,
            redirect: '/home',
            children: [
                {
                    path: '/home',
                    name: "home",
                    component: Home,
                    meta: {title: "首页"}
                },
            ]
        },*/
        {
            path: "/member",
            component: Layout,
            children: [
                {
                    path: "/",
                    component: Member,
                    name: "member",
                    meta: {title: "疫情查询"}
                }
            ]
        }/*,
        {
            path: "/supplier",
            component: Layout,
            children: [
                {
                    path: "/",
                    name: "supplier",
                    component: Supplier,
                    meta: {title: "供应商管理"}
                }
            ]
        },
        {
            path: "/goods",
            component: Layout,
            children: [
                {
                    path: "/",
                    component: Goods,
                    name: "goods",
                    meta: {title: "商品管理"}
                }
            ]
        },
        {
            path: "/staff",
            component: Layout,
            children: [
                {
                    path: "/",
                    name: "staff",
                    component: Staff,
                    meta: {title: "员工管理"}
                }
            ]
        }*/
    ],
    mode:'history'
})
